#include <REGX52.H>

/**
 * 1357先亮，然后2468再亮，交替闪烁
 */

void delay_ms(unsigned int ms)
{
    unsigned int i, j;
    for (i = 0; i < ms; i++)
    {
        for (j = 0; j < 123; j++)
            ;
    }
}

void main()
{
    P2=0xFF;
    while(1){
        P2_0=0;
        P2_2=0;
        P2_4=0;
        P2_6=0;
        P2_1=1;
        P2_3=1;
        P2_5=1;
        P2_7=1;
        delay_ms(2000);
        P2_0=1;
        P2_2=1;
        P2_4=1;
        P2_6=1;
        P2_1=0;
        P2_3=0;
        P2_5=0;
        P2_7=0;
        delay_ms(2000);

      

    }
}